<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<style type="text/css">
.dateWidth1 {
	width: 195px;
}

.select_width {
	width: 130px;
}
</style>
<x:parse xml="${param.xmlstr}" var="xmlData" />

<table class="t_css" width="100%" border="0" cellpadding="0"
	id="basicInfo" cellspacing="1">
	<tr>
		<td colspan="6" class="t_bar2">基本信息</td>

	</tr>
	<tr>
		<td align="right"><span class="color_red">*</span>项目名称：</td>
		<td colspan="3"><input id="zh_title" name="proposal/zh_title"
			label="项目名称" type="text" required
			class="input_css required maxlength:100" style="width: 725px;"
			maxlength="100"
			value="<x:out select="$xmlData/data/proposal/zh_title" />" /></td>
	</tr>

	<tr>
		
		<td align="right" nowrap><span class="color_red">*</span>批准文件（文号）：</td>
		<td><input name="proposal/file_no" label="批准文件（文号）" type="text"
			required class="input_css required maxlength:100" maxlength="100"
			value="<x:out select="$xmlData/data/proposal/file_no" />" /></td>
		<td align="right" nowrap><span class="color_red">*</span>认定日期：</td>
		<td><c:set var="hold_date">
				<x:out select="$xmlData/data/proposal/hold_date" />
			</c:set> <cpt:date id="hold_date" name="proposal/hold_date"
				value="${hold_date}" className=" required date" label="认定日期"></cpt:date>
		</td>
	</tr>

	<tr>
		<td align="right"><span class="color_red">*</span>认定类别：</td>
		<td nowrap colspan="3" valign="middle">
		<label> 
			<input type="radio" class="do " id="advant_01"
				style="vertical-align: middle;" name="research" label="现有总部认定"
				value="01" /><span style="vertical-align: middle;">现有总部认定</span></label> <label>
			<input type="radio" class="do " id="advant_02"
				style="vertical-align: middle;" name="research" label="新设立总部认定"
				value="02" /><span style="vertical-align: middle;">新设立总部认定</span>
		</label>  
		<input type="hidden" name="proposal/research_value" id="research_value" class="required"
		value="<x:out select="$xmlData/data/proposal/research_value" />" label="认定类别" /> 
		<input type="hidden" name="proposal/research_name" id="research_name" 
		value="<x:out select="$xmlData/data/proposal/research_name" />"/></td>
	</tr>

	<tr>
		<td align="right"><span class="color_red">*</span>总部类型：</td>
		<td nowrap colspan="3" valign="middle"><label> <input
				type="radio" class="do " id="nature_01"
				style="vertical-align: middle;" name="nature_type" label="综合型总部"
				value="01" /><span style="vertical-align: middle;">综合型总部</span></label> <label>
				<input type="radio" class="do " id="nature_02"
				style="vertical-align: middle;" name="nature_type" label="功能型总部"
				value="02" /><span style="vertical-align: middle;">功能型总部</span>
		</label> <input type="hidden" name="proposal/nature_type_value"
			id="nature_type_value" class="required"
			value="<x:out select="$xmlData/data/proposal/nature_type_value" />"
			label="总部类型" /> <input type="hidden"
			name="proposal/nature_type_name" id="nature_type_name"
			value="<x:out select="$xmlData/data/proposal/nature_type_name" />"
			label="总部类型" /></td>
	</tr>

        
	<tr>
		<td align="right" nowrap><span class="color_red">*</span>总部特性：</td>
		<td nowrap colspan="5"><c:set var="office_feature">
				<x:out select="$xmlData/data/proposal/office_feature_value" />
			</c:set> <cpt:checkbox key="office_feature" name="office_feature" repeatColumn="5"
				style="border: 0px; padding: 0px; margin: 0px;float:left;"></cpt:checkbox>
			<input type="hidden" id="office_feature_value"
			name="proposal/office_feature_value" class="required" value="${office_feature}"
			label="总部特性"> <input type="hidden"
			name="proposal/office_feature_name"
			value="<x:out select="$xmlData/data/proposal/office_feature_name" />">
		</td>
	</tr>
	  
		<tr>
		<td align="right" nowrap><span class="color_red">*</span>总部功能：</td>
		<td nowrap colspan="5"><c:set var="office_function">
				<x:out select="$xmlData/data/proposal/office_function_value" />
			</c:set> <cpt:checkbox key="office_function" name="office_function" repeatColumn="6"
				style="border: 0px; padding: 0px; margin: 0px;float:left;"></cpt:checkbox>
			<input type="hidden" id="office_function_value"
			name="proposal/office_function_value" class="required" value="${office_function}"
			label="总部功能"> <input type="hidden"
			name="proposal/office_function_name"
			value="<x:out select="$xmlData/data/proposal/office_function_name" />">
			<c:set var="office_function_other"><x:out select="$xmlData/data/proposal/office_function_other" /></c:set>
		</td>
	</tr> 
	<tr>
		<td align="right" nowrap><span class="color_red">*</span>申报日期：</td>
		<td colspan="3"><c:set var="submit_date">
				<x:out select="$xmlData/data/proposal/submit_date" />
			</c:set> <cpt:date id="submit_date" name="proposal/submit_date"
				value="${submit_date}" className=" required date" label="申报日期"></cpt:date>
		</td>

	</tr>
</table>
<table class="t_css" width="100%" border="0" cellpadding="0"
	id="basicInfo2" cellspacing="1">
	<tr>
		<td colspan="4" class="t_bar2">上年度主要经营状况</td>

	</tr>
	<tr>
	<td align="right">注册资本：</td>
	<td align="center"><span name="proposal/org_registe_fund"><x:out select="$xmlData/data/org_basic_info/registe_fund" /></span>万<span name="proposal/org_registe_fund_money_name"><x:out select="$xmlData/data/organizations/organization[@submit_org='1']/registe_fund_money_name" /></span>
	 </td>
	<td align="right">注册时间：</td>
	<td align="center"><x:out select="$xmlData/data/organizations/organization[@submit_org='1']/registe_date" /></td>
	</tr>
    <tr>
	<td align="right">资产总额（万元）：</td>
	<td align="center"><span id="total_assets" name="proposal/total_assets"></span></td>
	<td align="right">净资产（万元）：</td>
	<td align="center"><span id="net_asset" name="proposal/net_asset"></span></td>
	</tr>
	<tr>
	<td align="right">营业收入（万元）：</td>
	<td align="center"><span id="business_sale" name="proposal/business_sale"></span></td>
	<td align="right">员工人数（人）：</td>
	<td align="center"><x:out select="$xmlData/data/organization_persons/people_count_total"/></td>
	</tr>
	<tr>
		<td colspan="4" class="t_bar2">${year-2 }年度税收贡献情况</td>

	</tr>
	<tr align="center">
	<td>合计</td>
	<td>增值税（万元）</td>
	<td>营业税（万元）</td>
	<td>企业所得税（万元）</td>
	</tr>
	<tr align="center">
	<td><span id="total_total" name="proposal/total_total"></span></td>
	<td><span id="total_add" name="proposal/total_add"></span></td>
	<td><span id="total_business" name="proposal/total_business"></span></td>
	<td><span id="total_organization" name="proposal/total_organization"></span></td>
	</tr>
	<tr>
		<td colspan="4" class="t_bar2"><span class="color_red">*</span>${year-1 }年度税收贡献情况</td>

	</tr>
	<tr align="center">
	<td>合计</td>
	<td>增值税（万元）</td>
	<td>营业税（万元）</td>
	<td>企业所得税（万元）</td>
	</tr>
	<tr align="center">
	<td><span id="sale_totoal" name="proposal/sale_totoal"></span></td>
	<td><span id="sale_add" name="proposal/sale_add"></span></td>
	<td><span id="sale_business" name="proposal/sale_business"></span></td>
	<td><span id="sale_organization" name="proposal/sale_organization"></span></td>
	</tr>
	<%-- <tr align="center">
	<td><input name="proposal/sale_totoal" label="本年度税收贡献情况-->合计" class="gray" disabled id="sale_totoal" onfocus="InitInput.setNumber(this,7,4,2)"  value="<x:out select="$xmlData/data/proposal/sale_totoal"/>" style="text-align:right"/></td>
	<td><input name="proposal/sale_add"   label="本年度税收贡献情况-->增值税"  class="required" onchange="countFundAuto('sale_','business,add,organization','totoal');"  id="sale_add" onfocus="InitInput.setNumber(this,7,4,2)"  value="<x:out select="$xmlData/data/proposal/sale_add"/>" style="text-align:right"/></td>
	<td><input name="proposal/sale_business"   label="本年度税收贡献情况-->营业税"  class="required" onchange="countFundAuto('sale_','business,add,organization','totoal');" id="sale_business" onfocus="InitInput.setNumber(this,7,4,2)"  value="<x:out select="$xmlData/data/proposal/sale_business"/>" style="text-align:right"/></td>
	<td><input name="proposal/sale_organization"  label="本年度税收贡献情况-->企业所得税" class="required"  onchange="countFundAuto('sale_','business,add,organization','totoal');"  id="sale_organization" onfocus="InitInput.setNumber(this,7,4,2)"  value="<x:out select="$xmlData/data/proposal/sale_organization"/>" style="text-align:right"/></td>
	</tr> --%>
	
	<tr>
		<td colspan="4" class="t_bar2"><span class="color_red">*</span>下属控股企业或分支机构情况</td>

	</tr>
	<tr>
	<td align="right">下属控股企业或分支机构数量（个）：</td>
	<td align="center"><input name="proposal/office_amount"  label="下属控股企业或分支机构数量" class="required" onfocus="InitInput.setNumber(this,7,0,0)"  value="<x:out select="$xmlData/data/proposal/office_amount"/>" style="text-align:right"/></td>
	<td align="right">营业收入中来自下属分支机构的比例（%）：</td>
	<td align="center"><input name="proposal/office_amount_pre" label="营业收入中来自下属分支机构的比例" class="required"   onfocus="InitInput.setNumber(this,7,2,2)"  value="<x:out select="$xmlData/data/proposal/office_amount_pre"/>" style="text-align:right"/></td>
	</tr>
	
</table>
<div class="t_bar"><span class="color_red">*</span>本市外控股企业或分支机构情况</div>
<table  id="tblEuipments" cellpadding="0" class="t_css" width="100%" border="0" cellpadding="0" style="*border-bottom: #a1c0dc 1px solid;">
			<thead >
					<tr style="border:1px solid #B7D1E6">
						<th class="TblHead" align="center"  width="5%">选择</th>
						<th class="TblHead" align="center"  width="5%">序号</th>
						<th class="TblHead" align="center"  width="15%">机构名称</th> 
				        <th class="TblHead" align="center"  width="14%">出资比例（%）</th> 
						<th class="TblHead" align="center"  width="14%">出资时间</th>
						<th class="TblHead" align="center"  width="15%">注册地</th> 
				        <th class="TblHead" align="center"  width="15%">营业收入（万元）</th> 
						<th class="TblHead" align="center"  width="17%">对我市税收贡献（万元）</th>  
					</tr>
			</thead>
			<tbody id="tab">
					<tr style="display:none">
						<td align="center">&nbsp;
							<input type="radio" class="radiobutton" name="selEuipments" >
						</td>
						<td align="center">&nbsp;
							<span name="euipments|euipment[0]@seq_no" >[index]</span> 
						</td>
						<td>
							<input type="text" name="euipments|euipment[0]|name"  label="机构名称" class=" input_text required" maxlength="50" style="width:80%"/>
						</td>
						
						<td>
							<input type="text" id="euipment_budget_pre_[0]" name="euipments|euipment[0]|budget_pre" label="出资比例"  onfocus="InitInput.setNumber(this,7,2,2)" onchange="countTable('tblEuipments','budget_pre_total','3')"   style="text-align:right;width:80%" class=" input_text required" />
						</td> 
						<td align="center" nowrap>
							<input id="euipment_start_date_[0]"  name="euipments|euipment[0]|start_date" label="出资时间" value="" class=" required input_text date " style="width:70px" /></td>
						<td>
							<input type="text" name="euipments|euipment[0]|address" label="注册地" class=" input_text required" maxlength="50" style="width:80%"/>
						</td>
						
						<td>
							<input type="text" id="euipment_income_[0]" name="euipments|euipment[0]|income"  label="营业收入" onfocus="InitInput.setNumber(this,7,4,2)" onchange="countTable('tblEuipments','income_total','6')"   style="text-align:right;width:80%" class=" input_text required" />
						</td> 
						<td>
							<input type="text" id="euipment_sale_[0]" name="euipments|euipment[0]|sale" label="对我市税收贡献"  onfocus="InitInput.setNumber(this,7,4,2)" onchange="countTable('tblEuipments','sale_total','7')"   style="text-align:right;width:80%" class=" input_text required" />
						</td> 
					</tr>
					
					<c:set value="0" var="index" scope="page"/>
					<x:forEach select="$xmlData/data/euipments/euipment" var="euipment">
					
					<c:choose>
						<c:when test="${index<10}" ><c:set value="0" var="flag" scope="page"/></c:when>
						<c:otherwise><c:set value="" var="flag" scope="page"/></c:otherwise>
					</c:choose>
					<tr >
						<td align="center">&nbsp;
							<input type="radio" class="radiobutton" name="selEuipments" >
						</td>
						<td align="center">&nbsp;
							<span name="euipments/euipment[${flag}${index}]@seq_no" ><x:out select="$euipment/@seq_no"/></span> 
						</td>
						<td>
							<input type="text" name="euipments/euipment[${flag}${index}]/name" label="机构名称"   style="width:80%"   class=" input_text required" value="<x:out select="$euipment/name" />" maxlength="50"/>
						</td>
						
						<td >
							<input type="text" id="euipment_budget_pre_[${flag}${index}]" name="euipments/euipment[${flag}${index}]/budget_pre" label="出资比例"   onfocus="InitInput.setNumber(this,7,2,2)"  onchange="countTable('tblEuipments','budget_pre_total','3')"  style="text-align:right;width:80%"  class=" input_text required" value="<x:out select="$euipment/budget_pre" />"/>
						</td> 
						<td align="center" nowrap><c:set var="start_date" scope="page"><x:out select="$euipment/start_date"/></c:set>
							<input  id="euipment_start_date_[${flag}${index}]"  value="${start_date}" name="euipments/euipment[${flag}${index}]/start_date" class="required date input_text" style="width:70px" label="出资时间" /> 
						</td>
						
						<td>
							<input type="text" name="euipments/euipment[${flag}${index}]/address" label="注册地"  style="width:80%"   class=" input_text required" value="<x:out select="$euipment/address" />" maxlength="50"/>
						</td>
						
						<td >
							<input type="text" id="euipment_income_[${flag}${index}]"name="euipments/euipment[${flag}${index}]/income" label="营业收入"  onfocus="InitInput.setNumber(this,7,4,2)" onchange="countTable('tblEuipments','income_total','6')"    style="text-align:right;width:80%"  class=" input_text required" value="<x:out select="$euipment/income" />"/>
						</td> 
						<td >
							<input type="text" id="euipment_sale_[${flag}${index}]" name="euipments/euipment[${flag}${index}]/sale"  label="对我市税收贡献" onfocus="InitInput.setNumber(this,7,4,2)"  onchange="countTable('tblEuipments','sale_total','7')"   style="text-align:right;width:80%"  class=" input_text required" value="<x:out select="$euipment/sale" />"/>
						</td> 
					</tr>
					<c:set value="${index+1}" var="index" scope="page"/>
					</x:forEach>
					<script type="text/javascript">
						showAllDateTag("tblEuipments");
		                </script>
					</tbody>
				</table>
				<table class="t_css" width="100%" align="center">
						<col style="width:5%">
						<col style="width:5%">
						<col style="width:15%">
						<col style="width:14%">
						<col style="width:14%">
						<col style="width:15%">
						<col style="width:15%">
						<col style="width:17%">
					<tr>
					<td colspan="3" align="center">合计</td>
					<td>
						<input type="text" name="euipments/budget_pre_total" id="budget_pre_total" label="出资比例之和" style="text-align:right;width:80%"  class="gray input_text" disabled value="<x:out select="$xmlData/data/euipments/budget_pre_total" />"/>
					</td>
					<td align="center">
						/
					</td>
					<td align="center">
						/
					</td>
					<td>
						<input type="text" name="euipments/income_total" id="income_total" label="营业收入之和"  style="text-align:right;width:80%"  class="gray input_text" disabled value="<x:out select="$xmlData/data/euipments/income_total" />"/>
					</td>
					<td>
						<input type="text" name="euipments/sale_total" id="sale_total" label="对我市税收贡献之和" style="text-align:right;width:80%"  class="gray input_text" disabled value="<x:out select="$xmlData/data/euipments/sale_total" />"/>
					</td>
					</tr>
				</table>
				<table width="98%" align="center">
					<tr><td>
					<input class="button" name="cmdAddbefore" type=button value="添加" onclick="if(checkTabLimit('tblEuipments',10,'最多只能添加10条本市外控股企业或分支机构信息')){addNewRow('tblEuipments');showDateTag('tblEuipments');try{top.resizeFrame();}catch(e){};}">
					<input class="button" name="cmdMovePrev" type=button value="上移" onclick="movePrev('tblEuipments','selEuipments')">
					<input class="button" name="cmdMoveNext" type=button value="下移" onclick="moveNext('tblEuipments','selEuipments')">
					<input class="button" name="cmddel" type=button  value="删除" onclick="deleteSelectedRow('tblEuipments','本市外控股企业或分支机构情况');countTable('tblEuipments','budget_pre_total','3');countTable('tblEuipments','income_total','6');countTable('tblEuipments','sale_total','7')">
					</td></tr>
				</table>	



<table class="t_css" width="100%" border="0" cellpadding="0"
	id="basicInfo4" cellspacing="1">
		<col style="width:20%">
		<col style="width:30%">
		<col style="width:20%">
		<col style="width:30%">
	<tr>
		<td colspan="4" class="t_bar2">申请项目资金情况（金额单位：万元）</td>

	</tr>
	<tr>
		<td align="right">项目类别：</td>
		<td><x:out select="$xmlData/data/proposal/grant_name" /></td>
		<td align="right">支持方式：</td>
		<td colspan="1"><span name="proposal/sponsor_category"><x:out
					select="$xmlData/data/proposal/sponsor_category" /></span></td>

	</tr>
	<tr>
	
		
		<td align="right"><span class="color_red">*</span>申请金额：</td>
		<td  >
			<input id="source_apply" name="proposal/total_funds" style="text-align:right;" onfocus="InitInput.setNumber(this,7,4,2)" label="申请金额" type="text" required class="input_css required"   maxlength="20" value="<x:out select="$xmlData/data/proposal/total_funds" />"/>万元 
		</td>
		<td  align="right">资金级次：</td>
		<td colspan="1">
		<span  name="proposal/fund_level">市级</span>
		</td>
	</tr>

	<tr>
		<td align="right" nowrap>归口管理部门：</td>
		<td><span name="proposal/org_name">无锡市发展和改革委员会</span></td>
		<td align="right">管理类别：</td>
		<td colspan="1"><span name="proposal/manage_category"><x:out
					select="$xmlData/data/proposal/manage_category" /></span></td>

	</tr>
	
	<tr style="display: none">
		<td colspan="4"></td>
	</tr>
	<tr>
		<td align="right" nowrap><span class="color_red">*</span>项目所属产业：</td>
		<td nowrap colspan="3"><c:set var="industry">
				<x:out select="$xmlData/data/proposal/industry_value" />
			</c:set> <cpt:checkbox key="industry" name="industry" repeatColumn="7"
				style="border: 0px; padding: 0px; margin: 0px;float:left;"></cpt:checkbox>
			<input type="hidden" id="industry_value"
			name="proposal/industry_value" class="required" value="${industry}"
			label="项目所属产业"> <input type="hidden"
			name="proposal/industry_name"
			value="<x:out select="$xmlData/data/proposal/industry_name" />">
		</td>
	</tr>
	<tr>
		<td align="right">功能分类：</td>
		<td colspan="3"><span name="proposal/grant_function"><x:out
					select="$xmlData/data/proposal/grant_function" /></span></td>

	</tr>
</table>
<table width="100%" border="0" cellpadding="0" cellspacing="1">
	<tr>
		<td class="t_bar2">申请资助依据条款</td>

	</tr>
	<tr>
		<td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span
			name="proposal/policy_foundation"><x:out
					select="$xmlData/data/proposal/policy_foundation" /></span>
		</td>
	</tr>
</table>
<br />





<table class="t_css" width="100%" border="0" cellpadding="0"
	cellspacing="1" id="basicInfo5">
	<tr>
		<td class="t_bar2" colspan="8">人员信息</td>

	</tr>
	<tr>
		<td align="right"><span class="color_red">*</span>项目联系人：</td>
		<td><input name="proposal/contact_psn_cname" label="项目联系人"
			type="text" required class="input_css required" maxlength="100"
			value="<x:out select="$xmlData/data/proposal/contact_psn_cname" />" />
		</td>
		<td align="right"><span class="color_red">*</span>联系电话：</td>
		<td><input name="proposal/contact_psn_tel" label="联系电话"
			type="text" required class="input_css required" maxlength="50"
			value="<x:out select="$xmlData/data/proposal/contact_psn_tel" />" />
		</td>
		<td align="right"><span class="color_red">*</span>联系手机：</td>
		<td><input name="proposal/contact_psn_mobile" label="联系手机"
			type="text" required maxlength="11" required
			class="input_css required mobile" maxlength="20"
			value="<x:out select="$xmlData/data/proposal/contact_psn_mobile" />" />
		</td>
		<td align="right"><span class="color_red">*</span>电子邮箱：</td>
		<td><input name="proposal/contact_psn_email" label="电子邮箱"
			type="text" required class="input_css required email" maxlength="100"
			value="<x:out select="$xmlData/data/proposal/contact_psn_email" />" />
		</td>
	</tr>
	<tr>
		<td  align="right">项目负责人：</td>
		<td>
			<input  name="proposal/fzr_psncode" type="hidden" required class="input_css "   maxlength="20" value="<x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/basic_info/psn_code" />"/> 
		    
		    <span name="proposal/fzr_psnname" ><x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/basic_info/zh_name" /></span>
		    <c:set var="psnCode"><x:out select="$xmlData/data/proposal/psn_code" /></c:set>
		    <security:authorize ifAnyGranted="A_DAILU_PROPOSAL">
				<span id="personSelect">
				<input type="button" class="button_02" style="height: 25px; padding: 1px;" id="selectPsn" value="设置">
				<cpt:personSelect key="personSelect"  addRole="3"  psnCode="${psnCode}" callback="selectPsnCall" bindEvent="click" bindObject="selectPsn" title="设置项目负责人" fltFile="personSelector.ftl"></cpt:personSelect>
				</span>
			</security:authorize>
		
		</td>
		<security:authorize ifNotGranted="A_DAILU_PROPOSAL"> 
		<td  align="right">联系电话：</td>
		<td  >
		<span name="proposal/fzr_tel"><x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/contact/tel_work" /></span>
		</td>
		<td  align="right">联系手机：</td>
		<td  >
		<span name="proposal/fzr_mobile"><x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/contact/mobile" /></span>
		</td>
		</security:authorize>
		<security:authorize ifAnyGranted="A_DAILU_PROPOSAL">
		<td  align="right"><span class="color_red">*</span>联系电话：</td>
		<td  >
		<input name="proposal/fzr_tel" label="项目负责人联系电话" type="text" required  class="input_css required"  onchange="synFzrMsg(1)"  maxlength="50"  value="<x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/contact/tel_work" />"/>
		</td>
		<td  align="right"><span class="color_red">*</span>联系手机：</td>
		<td  >
		<input name="proposal/fzr_mobile" label="项目负责人联系手机" type="text" onchange="synFzrMsg(1)" onfocus="InitInput.setNumber(this,11,0,0)"  maxlength="11"  class="input_css required mobile"   value="<x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/contact/mobile" />"/>
		</td>
		</security:authorize>
		<td  align="right">电子邮箱：</td>
		<td  >
		<span name="proposal/fzr_mail"><x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/contact/email" /></span>
		</td>
		
		</tr>


</table>

<script type="text/javascript">


$(function(){
	$("#total_assets").text(formatVal2($("#finance_930_4").text().replace(new RegExp("\,","g"), "")));
	$("#net_asset").text(formatVal2($("#finance_931_4").text().replace(new RegExp("\,","g"), "")));
	$("#business_sale").text(formatVal2($("#finance_90_4").text().replace(new RegExp("\,","g"), "")));
	
	$("#sale_add").text(formatVal2($("#finance_920_4").text().replace(new RegExp("\,","g"), "")));
	$("#sale_business").text(formatVal2($("#finance_921_4").text().replace(new RegExp("\,","g"), "")));
	$("#sale_organization").text(formatVal2($("#finance_922_4").text().replace(new RegExp("\,","g"), "")));
	
	$("#total_add").text(formatVal2($("#finance_920_2").text().replace(new RegExp("\,","g"), "")));
	$("#total_business").text(formatVal2($("#finance_921_2").text().replace(new RegExp("\,","g"), "")));
	$("#total_organization").text(formatVal2($("#finance_922_2").text().replace(new RegExp("\,","g"), "")));
	countFundSpanAuto("total_","add,business,organization","total");
	countFundSpanAuto("sale_","add,business,organization","totoal");
	
	//总部功能
	var chkLast = $("input[name='office_function']:last");
	var chkTd = chkLast.parent("td");
	var chk_characteristic_table = chkTd.parent("tr").parent("tbody");
	chk_characteristic_table.parent("table").attr("border","0");
	var trLen = chk_characteristic_table.find("tr").length;
	var tdLen = chk_characteristic_table.find("td").length;
	var tdNum = parseInt(tdLen%trLen==0 ? tdLen/trLen : (tdLen/trLen+1));
	chkTd.append('&nbsp;<input type="text" style="display:none" id="office_function_other" maxlength="20" name="proposal/office_function_other" value="${office_function_other}"/>');
	chkTd.attr("colspan", (1+tdNum));
	var chkOther = $("#office_function_other");
	if ($.trim(chkTd.text())=="其他" && chkLast.attr("checked")=="checked") {
		chkOther.show();
	}
	chkOther.keyup(function(){
		setChkValues("office_function");
	});
	
	regChkClickAction("office_function");//给checkbox注册点击事件
});

/**
 * 给checkbox注册点击事件
 */
function setChkValues(chkName) {
	var str_value = "";
	var str_name = "";
	var text = "";
	$("input[name='"+chkName+"']:checked").each(function(){
		str_value += "，"+$(this).val();
		text = $.trim($(this).parent().text());
		if (text == "其他" && chkName == "office_function") {
			if ($.trim($("#"+chkName+"_other").val()) != "")
				str_name += "，"+$("#"+chkName+"_other").val();
		} else {
			str_name += "，"+text;
		}
	});
	if (str_value.length > 0) {
		$("input[name$='"+chkName+"_value']").val(str_value.substring(1));
		$("input[name$='"+chkName+"_name']").val(str_name.substring(1));
	}
}
function regChkClickAction(chkName) {
	$("input[name='"+chkName+"']").click(function(){
		if (chkName == "office_function" && $.trim($(this).parent("td").text()) == "其他") {
			if ($(this).attr("checked") == "checked") {
				$("#"+chkName+"_other").show();
			}
			else {
				$("#"+chkName+"_other").hide();
				$("#"+chkName+"_other").val("");
			}
		}
		setChkValues(chkName);
	});
}





function setPre(){
	var  teach_staff=$("#teach_staff").val();
    var staff_total=$("#staff_total").val();
    $("#teach_staff_pre").val(formatVal(teach_staff*100/staff_total));
    
    var  research_staff=$("#research_staff").val();
   
    $("#research_staff_pre").val(formatVal(research_staff*100/staff_total));
    
    var  technology_staff=$("#technology_staff").val();
   
    $("#technology_staff_pre").val(formatVal(technology_staff*100/staff_total));
	
}

function countFundSpanAuto(idStart, countStr, totalStr) {

	var indexs = countStr.split(",");
	var count = 0;
	for ( var i = 0; i < indexs.length; i++) {
		var fund = $("#" + idStart + indexs[i]).text();
		if (!$.isNumeric(fund))
			fund = "0";
		count = ((parseFloat(count)*10000 + parseFloat(fund)*10000)/10000).toFixed(4);
	}

	count = formatNumberAuto(count.toString(), 9, 4, 2);// 格式化金额
	$("#" + idStart + totalStr).text(count);
}

function setEuipmentTotal(){
	var count = 1;
	var budget_pre_total = 0.00;
	var income_total = 0.00;
	var sale_total = 0.00;
	$("#tblEuipments tbody tr").each(function(){
		if(count!=1){//跳过第一行模版行
			var tr = $(this);
			var budget_pre = tr.find("input[id^='euipment_budget_pre']").first().val();
			var income = tr.find("input[id^='euipment_income']").first().val();
			var sale = tr.find("input[id^='euipment_sale']").first().val();
			if(budget_pre!=null && $.isNumeric(budget_pre)&& parseFloat(budget_pre)>0) budget_pre_total = parseFloat(budget_pre_total) + parseFloat(budget_pre);
			if(income!=null && $.isNumeric(income)&& parseFloat(income)>0) income_total = parseFloat(income_total) + parseFloat(income);
			if(sale!=null && $.isNumeric(sale)&& parseFloat(sale)>0) sale_total = parseFloat(sale_total) + parseFloat(sale);
		}
		count++;
	});
	$("#budget_pre_total").val(formatNumberAutoPro(budget_pre_total));
	$("#income_total").val(formatNumberAutoPro(income_total));
	$("#sale_total").val(formatNumberAutoPro(sale_total));
}


function formatNumberAutoPro(val){
	var count;
	if((formatNumberAuto(val.toString(), 9, 4, 2)*10000)%10000!=0)
		count=formatNumberAuto(val.toString()+'0000', 9, 4, 2);
	else
		count = formatNumberAuto(val.toString()+".0000", 9, 4, 2);
	return count;
}

</script>


